<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								终端编号：<input type="text" name="tid" id="tid"/>
							</li>

							<li>
								所属分组：<input type="text" name="aname"/>
							</li>

							<li>
								终端名称：<input type="text" name="tname"/>
							</li>

							<li>
								维护人员：<input type="text" name="mstaff"/>
							</li>

							<li>
								故障现象：<input type="text" name="fault"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()">
					<i class="fa fa-plus"></i> 添加
				</a>

				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="broad:maintain:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
			</div>

			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('broad:maintain:edit')}]];
        var removeFlag = [[${@permission.hasPermi('broad:maintain:remove')}]];
        var prefix = ctx + "broad/maintain";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                detailUrl: prefix + "/detail/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "终端维护记录",
				search: false,
		        showExport: true,
                columns: [
				{
					checkbox: true
				},
				{
					field : 'tmid',
					title : '终端维护记录-维护ID',
					visible: false
				},
				{
					field : 'tid',
					title : '终端编号',
					sortable: true
				},
				{
					field : 'tname',
					title : '终端名称',
					sortable: true
				},
				{
					field : 'aname',
					title : '所属分组',
					sortable: true
				},
				{
					field : 'uname',
					title : '上级分组',
					sortable: true
				},
				{
					field : 'phone',
					title : '终端号码',
					sortable: true
				},
				{
					field : 'address',
					title : '终端地址',
					sortable: true
				},
				{
					field : 'nettype',
					title : '网络类型',
					sortable: true
				},
				{
					field : 'fault', 
					title : '故障现象',
					sortable: true
				},
				{
					field : 'mstaff', 
					title : '维护人员',
					sortable: true
				},
				{
					field : 'createtime',
					title : '维护时间',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + '" href="#" onclick="$.operate.detail(\'' + row.tmid + '\')"><i class="fa fa-edit"></i>详细</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.tmid + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
<script>
    String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
    }
    $("#tid").change(function(){
        $(this).val($(this).val().trim());
    });
</script>
</body>
</html>